
<html>

<head>
<title>Staff Timesheet Entry</title>
<script LANGUAGE="JavaScript">
<!--
function y2k(number)    { return (number < 1000) ? number + 1900 : number; }
function padout(number) { return (number < 10) ? '0' + number : number; }

var today = new Date('9/1/2010');
var day = today.getDate();
var month = today.getMonth();
var year = y2k(today.getYear()), whichOne = 0;

function openCal()
    {
    day = today.getDate(), month = today.getMonth(), year = y2k(today.getYear());
    calendar=open('calendar.htm','calendar','resizable=no,width=315,height=245,top=0,left=0');
    calendar.location.href = 'calendar.htm';
    if (calendar.opener == null) calendar.opener = self;
    }

function openHelp(fname)
	{
	Help = open('help/' + fname + '.asp?EmpNo=1080','HELP','scrollbars=yes,width=400,height=470,top=80,left=390');
	}

function Validator(theForm)
{

  if (theForm.Project.selectedIndex == 0)
  {
    alert("Please select an Project.");
    theForm.Project.focus();
    return (false);
  }

  if (theForm.Activity.selectedIndex == 0 || theForm.Activity.options[theForm.Activity.selectedIndex].value == 'dummy')
  {
    alert("Please select an Activity.");
    theForm.Activity.focus();
    return (false);
  }

  if (theForm.Type.selectedIndex == 0)
  {
    alert("Please select a Type.");
    theForm.Type.focus();
    return (false);
  }

  if (theForm.Description.value == "")
  {
    alert("Please enter a Description.");
    theForm.Description.focus();
    return (false);
  }

  if (theForm.Description.value.length < 2)
  {
    alert("Please enter at least 2 characters in the Description field.");
    theForm.Description.focus();
    return (false);
  }

  if (theForm.Description.value.length > 255)
  {
    alert("Please enter max. 255 characters in the Description field.");
    theForm.Description.focus();
    return (false);
  }
  theForm.Description.value=replace(theForm.Description.value,'\'','\'\'')
  return (true);
}

function unload()
  {
  alert('Did you enter your Travel Expenses\nfor ' + TMS.FDate.value + ' to ' + TMS.TDate.value);
  }

function chkBill()
  {
  if (TMS.Activity.selectedIndex == 2 || TMS.Activity.selectedIndex == 7)
	{
	TMS.Billable.checked = true;
	return (true);
	}
	TMS.Billable.checked = false;
	return (false);
  }

function chkType(f)
  {
  if (TMS.Type.selectedIndex != 3)
	{
	alert ('Please book ' + f.text + ' as type Weekend');
	f.value = 0;
	f.focus;
	return (true);
	}
	return (false);
  }

function DayHrs()
	{
	chkVal = TMS.Hours.value + "+" + TMS.DayTotal.value;
  	chkVal = eval(chkVal);
  	prsVal = chkVal;

	TMS.DayTot.value = chkVal;

	if (chkVal != "" && !(prsVal >= 0 && prsVal <= 24))
  		{
    		alert("Which planet are you from??? We dont have " + chkVal + "hr days.");
    		TMS.Hours.value = 0;
    		DayHrs();
    		TMS.Hours.focus();
    		return (false);
  		}
  	TMS.Submit.focus();
  	return (true);
	}

function noChange(nf)
	{
	alert("You are not allowed to change these values !");
	nf.focus()
	}

function replace(string,text,by)
	{
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);

    return newstr;
}

function reshow(val1,val2) {
    selection = val1.options[val1.selectedIndex].value;
    
    a = selection.split('/');
    selection = a[0];
   
    for (var i = val2.length;i > 0;i--)
		val2.options[0] = null;
    
    reloading = true;
    showlinks(val2);
	val2.options[0].selected = true;
}

function showlinks(val2) {
	bFoundData = false;
	
	if (selection == '560') {
	bFoundData = true;
opt('dummy','cyan','--- General');
opt('95','','Annual Leave');
opt('98','','HR ');
opt('103','','Office Meetings & Socials');
opt('137','','Performance Discussion');
opt('144','','Public Holiday');
opt('99','','Research');
opt('100','','Sick Leave');
opt('101','','Special Leave');
opt('106','','Training (internal by AfriGIS)');
}
if (selection == '1049') {
	bFoundData = true;
opt('dummy','cyan','--- Development');
opt('43','','Bug Fixing');
opt('45','','Code Reviews');
opt('46','','Coding');
opt('47','','Database Design');
opt('49','','Database Maintenance');
opt('51','','Design');
opt('52','','Documentation');
opt('dummy','cyan','--- Functional Specialist');
opt('59','','Functional Requirements');
opt('60','','Functional Spec Review');
opt('61','','Functional Specification ');
opt('dummy','cyan','--- IT Support');
opt('142','','IT Support');
opt('dummy','cyan','--- Project Management');
opt('69','','Project Communication');
opt('64','','Project Documentation');
opt('136','','Project Meeting');
opt('65','','Project Resource Management');
opt('67','','Project Time Management');
opt('dummy','cyan','--- Quality Assurance');
opt('77','','Developer Testing');
opt('75','','Installation Testing');
opt('79','','Test Plans');
opt('78','','Testing');
opt('dummy','cyan','--- Technical Support');
opt('85','','e-mail Support');
opt('81','','Manuals');
}
if (selection == '1170') {
	bFoundData = true;
opt('dummy','cyan','--- General');
opt('1114','','Breakfast');
opt('1116','','Dinner');
opt('1115','','Lunch');
}
if (selection == '1171') {
	bFoundData = true;
opt('dummy','cyan','--- General');
opt('1117','','Recreation');
}
if (selection == '1175') {
	bFoundData = true;
opt('dummy','cyan','--- In Lieu Holiday');
opt('1119','','Public holiday exchange');
opt('1118','','Weekend exchange');
}
if (selection == '1184') {
	bFoundData = true;
opt('dummy','cyan','--- No Work');
opt('1120','','No Work');
}

	
	if (!bFoundData) {
		opt('dummy','red','Contact your Proj. Manager.');
	}
}

function opt(href,style,text) {
    if (reloading) {
        var optionName = new Option(text, href, false, false)
        var length = TMS.Activity.length;
        TMS.Activity.options[length] = optionName;
        TMS.Activity.options[length].style.background = style;
	} else {
        if (style != '') {
			document.write('<OPTION VALUE="',href,'" STYLE="backgound:',style,'">',text,'</OPTION>');
		} else {
			document.write('<OPTION VALUE="',href,'">',text,'</OPTION>');
		}
		
    }
}

//--></script>
</head>

<body >
<form name="TMS" method="POST" action="default.asp" onSubmit="return Validator(TMS)">
  
  <input type=hidden name=rate value=0>
  <input type=hidden name=edate value=01/09/2010>
  <div align="center">
    <center>
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr>
        <td width="40%"><font face="Arial" size="2"><b>Name : Mahbub Mozadded</b></font></td>
      </center>
      <td width="20%" align=center><font face="Arial" size="2"><b>Timesheet</b> <font face="Arial" size="1">(52557)</font></font></td>
      <td width="40%">
        <p align="right"><font face="Arial" size="2"><b>
        <a href="javascript:openCal()">Wednesday - 01/09/2010</a>
        <input type="button" value="<<" onClick="location.href='default.asp?t=p&EDate=25/08/2010'">
        <input type="button" value="<" onClick="location.href='default.asp?t=p&EDate=31/08/2010'">
        <input type="button" value=">" onClick="location.href='default.asp?t=m&EDate=02/09/2010'">
        <input type="button" value=">>" onClick="location.href='default.asp?t=m&EDate=08/09/2010'"></b></p>
      </td>
      </tr>
      <tr><td height=20></td></tr>
    </table>
  </div>
  <div align="center">
    <center>
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr>
        <td></td>
        <td><font face="Arial" size="2"><A Href="javascript:openHelp('project')"><b>Project</b></A></font></td>
		<td><font face="Arial" size="2"><A Href="javascript:openHelp('activity')"><b>Activity</b></a></font></td>
        <td><font face="Arial" size="2"><b>Type</b></font></td>
        <td><font face="Arial" size="2"><b>Billable</b></font></td>
        <td><font face="Arial" size="2"><b>Description</b></font></td>
        <td><font face="Arial" size="2"><b>Hours</b></font></td>
      </tr>
      <tr><td height=20 colspan=10>
		<input name=txtProjDescription style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; FONT-SIZE: 8pt; VISIBILITY: hidden; BORDER-LEFT: medium none; WIDTH: 300px;BORDER-BOTTOM: medium none; FONT-FAMILY: Arial; BACKGROUND-COLOR: #ffffcc"></td></tr>

       <tr>

      	<td><font face="Arial" size="1">

      		<A Href="Default.asp?Record=440283&EDate=01/09/2010">MOD</A> / <A Href="Default.asp?Rec=440283&Type=Del&EDate=01/09/2010">DEL</A>
</td>

	<td><font face="Arial" size="2">PRD1049</td>
        <td><font face="Arial" size="2">Coding</td>
        <td><font face="Arial" size="2">Normal</td>
        <td align=center><font face="Arial" size="2">Y</td>
        <td><font face="Arial" size="2">Thi is Description</td>
        <td align=right><font face="Arial" size="2"><b>1</B></td>
      </tr>

      <tr>

      	<td><font face="Arial" size="1">

      		<A Href="Default.asp?Record=440282&EDate=01/09/2010">MOD</A> / <A Href="Default.asp?Rec=440282&Type=Del&EDate=01/09/2010">DEL</A>
</td>

	<td><font face="Arial" size="2">PRD1049</td>
        <td><font face="Arial" size="2">Coding</td>
        <td><font face="Arial" size="2">Normal</td>
        <td align=center><font face="Arial" size="2">Y</td>
        <td><font face="Arial" size="2">Thi is Description</td>
        <td align=right><font face="Arial" size="2"><b>1</B></td>
      </tr>

      

      <tr><td height=20></td></tr>

      

      <tr>
        <td></td>
        <td><select size="1" name="Project" style="font-size: xx-small" 
			 onFocus="TMS.txtProjDescription.style.visibility = 'visible'" 
			 onBlur="TMS.txtProjDescription.style.visibility = 'hidden'" 
			 OnChange="TMS.txtProjDescription.value = this.options[this.selectedIndex].title; return reshow(this,TMS.Activity)">

        <option value="select">select</option>



			<option value="1170/0" title="Bangladesh Office Meal">BDO1170</option>

		

			<option value="1171/0" title="Bangladesh Leisure activities">BDO1171</option>

		

			<option value="1175/0" title="In Lieu Holiday">OMG1175</option>

		

			<option value="1184/0" title="No Work">OMG1184</option>

		

			<option value="560/1" title="AfriGIS Leave and Performance Discussions">OMG560</option>

		

			<option value="1049/250" title="iSearch Project ">PRD1049</option>

		

		</select></td>

        <td><select size="1" name="Activity" style="font-size: xx-small">
				<option value="select">select</option>
				

				
			</select>
		</td>

        <td><select size="1" name="Type" style="font-size: xx-small">

        <option value="select">select</option>



			<option value="1">Normal</option>

		

			<option value="1.5">Over-time</option>

		

			<option value="2">Weekend</option>

		

          </select></td>

        <td>

          <p align="center"><input type="checkbox" name="Billable" value="1" checked></p>
        
        </td>

        <td><input type="text" name="Description" size="30" style="font-size: xx-small"></td>
        <td><INPUT TYPE="text" value="0" name="Hours" Size="4" style="font-size: xx-small; font-weight: bold; float: right" onChange="DayHrs()"></td>

      </tr>

      <tr>
        <td colspan=2 valign=bottom height=40>
        
        <input type="submit" name="Submit" value="Submit" style="font-family: Arial; font-size: 8pt; font-weight: bold;"><input type="reset" value="Reset"  style="font-family: Arial; font-size: 8pt; font-weight: bold;">
        </td>
		<td align=right colspan=4 valign=top><font face="Arial" size="2"><b>Total Hours Worked :  </b></td>
        <td align=right valign=top><INPUT TYPE="hidden" value="2" name="DayTotal">
        <INPUT TYPE="text" value="2" name="DayTot" Size="4" style="font-size: xx-small; font-weight: bold" onFocus="noChange(TMS.Hours)"></td>
    </td>
    </table>

    <table width=100% border=0 style="font-family: Arial; font-size: 10pt; font-weight: bold">
    	<tr>
    		<td align=right>
    			Total Billable Hours :
    		</td>
    		<td width=50 align=right>
    			2.0
    		</td>
    	</tr>
    	<tr>
    		<td align=right>
    			% Billable Hours :
    		</td>
    		<td align=right>
    			100.00
    		</td>
    	</tr>
    </table>
    </center>
  </div>
</form>

</body>

<script language=javascript>
selection = '';

if (selection != '') { 
	obj = TMS.Activity;
	reloading = true;
	showlinks(obj);
	
	for (i=0;i<obj.length;i++) {
		if (obj.options[i].value == '') {
			obj.options[i].selected = true;
		}
	}
}
</script>

</html>
